<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户列表</title>
    <link rel="stylesheet" href="/blog/common/layui/css/layui.css" media="all">
</head>
<body>

<table id="userLists" lay-filter="test"></table>

<script src="/blog/common/layui/layui.js"></script>
<script>
    layui.use('table', function(){
        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#userLists'
            ,height: 315
            ,url: '/servlet/userLists' //数据接口
            ,page: false //开启分页
            ,cols: [[ //表头
                {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
                ,{field: 'nickname', title: '用户名', width:80}
                ,{field: 'name', title: '姓名', width:80, sort: true}
                ,{field: 'gender', title: '性别', width:80, sort: true}
                ,{field: 'city', title: '城市', width:80}
                ,{field: 'phone', title: '电话', width: 80, sort: true}
                ,{field: 'wechat', title: '微信', width: 80, sort: true}
                ,{field: 'qq', title: 'QQ号', width: 80}
                ,{field: 'email', title: '邮箱', width: 177}
                ,{field: 'regtime', title: '注册时间', width: 135, sort: true}
                ,{field: 'enable', title: '启用', width: 135, sort: true}
            ]]
        });

    });
</script>
</body>
</html>